package com.jlpay.openapi.demo.ledger.merchconf;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.MerchRevSettleUpdateRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.MerchRevSettleUpdateResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class MerchRevSettleUpdateService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MerchRevSettleUpdateService.class);

    public static void main(String[] args) {
        MerchRevSettleUpdateRequest merchRevSettleUpdateRequest = buildMerchRevSettleUpdateRequest();
        MerchRevSettleUpdateResponse merchRevSettleUpdateResponse = JlpayOpenApiService.openMerchService()
                .post(merchRevSettleUpdateRequest, MerchRevSettleUpdateResponse.class);
        LOGGER.info("分账配置入账方结算卡变更响应:{}", JsonUtils.toString(merchRevSettleUpdateResponse));
    }

    private static MerchRevSettleUpdateRequest buildMerchRevSettleUpdateRequest() {
        MerchRevSettleUpdateRequest merchRevSettleUpdateRequest = new MerchRevSettleUpdateRequest();
        merchRevSettleUpdateRequest.setOrgCode("50720711");
        merchRevSettleUpdateRequest.setMchId("849581183510017");
        merchRevSettleUpdateRequest.setBankCardNo("6226****1663");
        merchRevSettleUpdateRequest.setBankCardName("张三");
        merchRevSettleUpdateRequest.setBankCode("308");
        merchRevSettleUpdateRequest.setBankName("中国建设银行股份有限公司");
        merchRevSettleUpdateRequest.setBankBranchCode("105584000370");
        merchRevSettleUpdateRequest.setBankBranchName("中国建设银行股份有限公司深圳罗湖支行");
        return merchRevSettleUpdateRequest;
    }
}
